package com.zirenx.sys.service;

import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.SqlPara;
import com.jfinal.plugin.activerecord.TableMapping;
import com.zirenx.sys.model.SysDict;

import java.util.List;

public class SysDictService {

    private SysDict dao = new SysDict().dao();

    /**
     * 获取性别列表
     * @return
     */
     public List<SysDict> getSexList(){
         return dao.find("select * from sys_dict where type = ?","sex");
    }

    public Page<SysDict> paginate(int pageNumber, int pageSize, Kv kv) {
        SqlPara sqlPara = new SqlPara();
        sqlPara.setSql("select * from " + dao.getTableName());
        return dao.paginate(pageNumber, pageSize,sqlPara);
    }
}
